package com.itbac.simglemachinelimiting.controller;

import com.itbac.simglemachinelimiting.aop.BacRateLimiter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制器
 * @author: BacHe
 * @email: 1218585258@qq.com
 * @Date: 2020/8/15 22:14
 */
@RestController
@RequestMapping("/info")
public class InfoController {

    //http://localhost:8080/info/getInfo
    //浏览器上按 F5 刷新浏览器请求，查看限流效果
    @RequestMapping("/getInfo")
    @BacRateLimiter(
            permitsPerSecond = 1.0,
            timeout = 300
    )
    public String getInfo(){
        return "success  时间：" + System.currentTimeMillis();
    }

}
